<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="wx_assets/css/storedetail/style1.css"
        media="all">
    <title>{$name}</title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
        name="viewport">
    <!-- Mobile Devices Support @begin -->
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=yes, address=no" name="format-detection">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- apple devices fullscreen -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Mobile Devices Support @end -->

    <script src="http://res.wx.qq.com/mmbizwap/en_US/htmledition/js/wxm-core1530d0.js"></script>

</head>
<body onselectstart="return true;" ondragstart="return false;">
    <div data-role="container" class="container">
        <header data-role="header">
		<section id="imgSwipe" class="img_swipe">
			<ul>
				<li>
					<a><img src="{$picUrl}">
						<span><i class="ico_ad"></i>{$name}</span>
					</a>
				</li>
			</ul>
		</section>
	    </header>
        <section data-role="body" class="page-bd">
		    <article class="article">
		        {$webPage.content}
		    </article>
	    </section>
        <div class="btn-panel">
            <a href="javascript:window.scrollTo(0,0);" style="font-size: 12px; margin: 0 auto;
                display: block; color: #fff; text-align: center; line-height: 35px; background: #333;
                margin-bottom: -10px;">返回顶部</a>
        </div>
    </div>

    <script>
        var baseUrl = '{$Think.config.SERVER_HOST}';
        function getParam(o) {
            var reg = new RegExp(
            "(^|\\?|&|#)"
                + o
                + "=([^&#]*)(&|\x24|#)",
            "");
            url = location.href,
            match = url.match(reg);
            if (match) {
                return decodeURIComponent(match[2]);
            }
            return null;
        }
        (function() {
            var onBridgeReady = function() {
                var titleString = "{$name}";
                var baseUrl = '{$Think.config.SERVER_HOST}';
                var link = location.href + "#mp.weixin.qq.com";
                link = encodeURI(link);

                var appId = '',
                    title = htmlDecode(titleString),
                    desc = htmlDecode(desString),
				    imgUrl = encodeURI('{$picUrl}'),
				    fakeid = "Mjc2OTgzMTM1",
				    desc = desc || link;

                // 发送给好友; 
                WeixinJSBridge.on('menu:share:appmessage', function(argv) {
                    WeixinJSBridge.invoke('sendAppMessage', {
                        "appid": appId,
                        "img_url": imgUrl,
                        "img_width": "640",
                        "img_height": "640",
                        "link": share_scene(link, 1),
                        "desc": desc,
                        "title": title
                    }, function(res) {
                        report(link, fakeid, 1);
                    });
                });
                // 分享到朋友圈;
                WeixinJSBridge.on('menu:share:timeline', function(argv) {
                    report(link, fakeid, 2);
                    WeixinJSBridge.invoke('shareTimeline', {
                        "img_url": imgUrl,
                        "img_width": "640",
                        "img_height": "640",
                        "link": share_scene(link, 2),
                        "desc": desc,
                        "title": title
                    }, function(res) {
                    });
                });
                // 分享到微博;
                var weiboContent = '';
                WeixinJSBridge.on('menu:share:weibo', function(argv) {
                    WeixinJSBridge.invoke('shareWeibo', {
                        "content": title + share_scene(link, 3),
                        "url": share_scene(link, 3)
                    }, function(res) {
                        report(link, fakeid, 3);
                    });
                });
            };
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        })();
    </script>

</body>
</html>
